const app = getApp()
// import {
//   getNotesUserFollowList,
//   getNotesFollowList,
//   getNotesRecommendList
// } from '../../server/api'

Page({

  /**
   * 页面的初始数据
   */
  data: {
    show: false,
    show1: false,
    value: "",
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    this.setData({show: true})

  },

  onPullDownRefresh() {

    wx.stopPullDownRefresh();
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    this.setData({
      loading: true
    });
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },

  onClickShow() {
    this.setData({ show: true });
  },

  onClickHide() {
    this.setData({ show: false, show1: false });
  },

  // onClickQuery(e) {
  //   const { expressNo } = e.currentTarget.dataset;
  //   // this.setData({ show: true });
  //   wx.redirectTo({
  //     url: '/pages/index/subpages/logistics-detail/index?expressNo='+expressNo
  //   });
  // },
  onChange(e) {
    this.setData({
      value: e.detail,
    });
  },

  onSearch() {
    const { value } = this.data;
    if (!value.trim().length){
      wx.showToast({
        title: "请输入发货单号",
        icon: 'error',
        duration: 2000
      })
      return;
    }
    wx.navigateTo({
      url: '/pages/index/subpages/logistics-detail/index?expressNo='+this.data.value
    });
  },

  noop() {},

  noop1() {
    this.setData({
      show1: true,
    })
  },
  
  onClickToHome() {
    wx.switchTab({
      url: "/pages/index/index",
    })
  },
})